package com.huli.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huli.domain.Carport;
import com.huli.vo.CarportVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


public interface CarportMapper extends BaseMapper<Carport> {
//    IPage<CarportVo> selectAllCarport(Page<CarportVo> page, CarportParam carportParam);
    @Select("SELECT carport_id,\n" +
            "        o.owner_name,\n" +
            "        carport_image,\n" +
            "        carport_description,\n" +
            "        carport_price,\n" +
            "        carport_certificate,\n" +
            "        carport_check,\n" +
            "        carport_status,\n" +
            "        property_company_id,\n" +
            "        garage_address,\n" +
            "        garage_site\n" +
            "        FROM carport AS c\n" +
            "        INNER JOIN garage AS g\n" +
            "        ON c.garage_id = g.garage_id\n" +
            "        LEFT JOIN owner AS o ON o.owner_id = c.owner_id ${ew.customSqlSegment}")
    IPage<CarportVo> selectAllCarport(Page<CarportVo> page,@Param(Constants.WRAPPER) QueryWrapper<CarportVo> queryWrapper);

}
